<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
	<title>Say Good Bye</title>
	<script language="JavaScript">
		function sayGoodbye()
		{
			var name = "Anonymous";
			if(document.mainForm.userName.value != "")
			{
				name = document.mainForm.userName.value;
			}
			
			alert("Good Bye, " + name);
		}
	</script>
</head>
	
<body onunload="sayGoodbye()">
	<form name="mainForm" action="" method="post">
		Enter Your Name: <input type="text" name="userName" />
		<br />
	</form>
</body>
</html>